package com.foreknow.demo4;

public abstract class X {
    public abstract void init();
}

class Y extends X{

    @Override
    public void init() {
        System.out.println("init........");
    }
}
class Z extends X{

    @Override
    public void init() {
        System.out.println("zzzzzzzzzzzzzzzzzzzzz");
    }
}
class K{
    public void m(X x){
        x.init();
    }
    public X m2(){
        X x =new Y();
        return x;
    }

    public static void main(String[] args) {
        K k = new K();
        X x = new Y();
        k.m(x);

        x= new Z();
        k.m(x);
    }
}
